package com.systemsjr.jrappointment.service;

import javax.swing.JComponent;

import com.systemsjr.jrappointment.service.vo.ServiceSearchCriteria;
import com.systemsjr.jrappointment.utils.ServiceUtils;
import com.systemsjr.jrlib.richclient.BaseItemFilterForm;
import com.systemsjr.jrlib.richclient.table.JRTableUtils;

public class ServiceFilterForm extends BaseItemFilterForm<ServiceSearchCriteria> {

	public ServiceFilterForm() {
		super("serviceFilterForm");
	}

	@Override
	protected void doSearch() {
		commit();
		ServiceSearchCriteria criteria = (ServiceSearchCriteria) getFormObject();
		JRTableUtils.refreshTable(table, ServiceUtils.getServiceService().search(criteria));
		
	}

	@Override
	protected void doCreateFormControl() {
		builder.row();
		builder.add("code");
		builder.row();
		builder.add("serviceName");
		builder.row();
	}
	
	@Override
	protected Object newFormObject() {
		ServiceSearchCriteria criteria = new ServiceSearchCriteria();
		
		return criteria;
	}

}
